import tkinter as tk

class MyWindow():
    def __init__(self,app):
        self.app = app
        self.app.title("Hello tkinter!")
        self.app.geometry("%dx%d+%d+%d" % (200,200,200,200))

        self.label = tk.Label(self.app,text="这是内容",font=('黑体',20))
        # pack 一种放置组件的方式，顺序放置
        self.label.pack()

if __name__ == '__main__':
    app = tk.Tk()
    window = MyWindow(app)
    app.mainloop()